package com.app.micaihu.bean.comment;

import android.text.TextUtils;

import com.app.micaihu.bean.ad.NativeAd;
import com.app.micaihu.bean.speak.ILaud;
import com.app.micaihu.configure.TypeConstant;

import java.util.List;

/**
 * 评论
 * Created by linkai on 2016/7/21.
 */
public class NewsComment implements ILaud{

    private String id;//评论id
    private String uid;//评论用户id
    private String nickName;//用户昵称
    private String articleId;//文章id
    private String content;//评论内容
    private String praiseNum;//评论点赞数
    private String publishTime;//评论发表时间
    private String headPic;//用户头像
    private String rankIcon;//用户军衔图标
    private String childNum;//子评论总数
    private String rankName;//军衔等级
    private String status;//评论状态： 0正常  1 未审核  2删除
    private List<NewsComment> childList;//回复集合
    private String parentCmtId;//父评论id
    private String pUid;//父评论的用户id
    private String pNickName;//父评论昵称
    private String type;//子评论类型  1 一级子评论 2 二级子评论
    private String commentTypeName;//评论类型的名字
    private String isFans;//是否是粉丝，1是 0否

    public boolean isHide;//该评论是否隐藏

    //210--游戏星星
    private String star;//游戏评论的评分

    private String honourPic;//军团勋章
    private String armyGroupInfo;//所属军团 或 军团职位
    private String gid;//所属军团 id
    private NativeAd nativeAd;//包含的广告

    public NativeAd getNativeAd() {
        return nativeAd;
    }

    public void setNativeAd(NativeAd nativeAd) {
        this.nativeAd = nativeAd;
    }

    public String getGid() {
        return gid;
    }

    public void setGid(String gid) {
        this.gid = gid;
    }

    public String getHonourPic() {
        return honourPic;
    }

    public void setHonourPic(String honourPic) {
        this.honourPic = honourPic;
    }

    public String getArmyGroupInfo() {
        return armyGroupInfo;
    }

    public void setArmyGroupInfo(String armyGroupInfo) {
        this.armyGroupInfo = armyGroupInfo;
    }

    public String getStar() {
        return star;
    }

    public void setStar(String star) {
        this.star = star;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getUid() {
        return uid;
    }

    public void setUid(String uid) {
        this.uid = uid;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getArticleId() {
        return articleId;
    }

    public void setArticleId(String articleId) {
        this.articleId = articleId;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getParentCmtId() {
        return parentCmtId;
    }

    public void setParentCmtId(String parentCmtId) {
        this.parentCmtId = parentCmtId;
    }

    public String getPraiseNum() {
        return praiseNum;
    }

    public void setPraiseNum(String praiseNum) {
        this.praiseNum = praiseNum;
    }

    public String getPublishTime() {
        return publishTime;
    }

    public void setPublishTime(String publishTime) {
        this.publishTime = publishTime;
    }

    public String getHeadPic() {
        return headPic;
    }

    public void setHeadPic(String headPic) {
        this.headPic = headPic;
    }

    public String getRankIcon() {
        return rankIcon;
    }

    public void setRankIcon(String rankIcon) {
        this.rankIcon = rankIcon;
    }

    public String getChildNum() {
        return childNum;
    }

    public void setChildNum(String childNum) {
        this.childNum = childNum;
    }

    public String getRankName() {
        return rankName;
    }

    public void setRankName(String rankName) {
        this.rankName = rankName;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
        //如果未审核 则隐藏
        if("1".equals(status)){
            this.isHide = true;
        }else{
            this.isHide = false;
        }
    }

    public List<NewsComment> getChildList() {
        return childList;
    }

    public void setChildList(List<NewsComment> childList) {
        this.childList = childList;
    }

    public String getpUid() {
        return pUid;
    }

    public void setpUid(String pUid) {
        this.pUid = pUid;
    }

    public String getpNickName() {
        return pNickName;
    }

    public void setpNickName(String pNickName) {
        this.pNickName = pNickName;
    }

    public String getType() {
        if(TextUtils.isEmpty(type)){
            type = "0";
        }
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getReplyType(){
        //2级子评论的返回@
        if(TextUtils.equals(type, TypeConstant.COMMENT_TWO)){
            return "@";
        }
        return "";
    }

    public String getCommentTypeName() {
        return commentTypeName;
    }

    public void setCommentTypeName(String commentTypeName) {
        this.commentTypeName = commentTypeName;
    }

    public boolean getIsFans() {
        if(TextUtils.equals(isFans,"1")){
            return true;
        }
        return false;
    }

    public void setIsFans(String isFans) {
        this.isFans = isFans;
    }




    /********************点赞的实现************************/

    @Override
    public String getILaudOperateType() {
        return TypeConstant.ZAN_NORMAL;
    }

    @Override
    public String getILaudNum() {
        return getPraiseNum();
    }

    @Override
    public String getILaudType() {
        return TypeConstant.COMMENT_ONE;
    }

    @Override
    public void setILaudNum(String iLaudNum) {
        setPraiseNum(iLaudNum);

    }

    @Override
    public String getNewsId() {
        return getArticleId();
    }

    @Override
    public String getICommentId() {
        return getId();
    }

    @Override
    public String getIParentCmtId() {
        return getParentCmtId() != null ? getParentCmtId() : "0";
    }

    @Override
    public String getIType() {
        return  getType();
    }

    @Override
    public String getIToUid() {
        return getUid();
    }

    @Override
    public void setIToUid(String toUid) {

    }
}
